3.2166 \(\int x (3-4 x+x^2)^2 \, dx\)

Optimal. Leaf size=34 \[ \frac{x^6}{6}-\frac{8 x^5}{5}+\frac{11 x^4}{2}-8 x^3+\frac{9 x^2}{2} \]

[Out]

(9*x^2)/2 - 8*x^3 + (11*x^4)/2 - (8*x^5)/5 + x^6/6

________________________________________________________________________________________

Rubi [A]  time = 0.0107675, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {631} \[ \frac{x^6}{6}-\frac{8 x^5}{5}+\frac{11 x^4}{2}-8 x^3+\frac{9 x^2}{2} \]

Antiderivative was successfully verified.

[In]

Int[x*(3 - 4*x + x^2)^2,x]

[Out]

(9*x^2)/2 - 8*x^3 + (11*x^4)/2 - (8*x^5)/5 + x^6/6

Rule 631

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)
*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && IntegerQ[p] && (GtQ[p, 0]
|| EqQ[a, 0])

Rubi steps

\begin{align*} \int x \left (3-4 x+x^2\right )^2 \, dx &=\int \left (9 x-24 x^2+22 x^3-8 x^4+x^5\right ) \, dx\\ &=\frac{9 x^2}{2}-8 x^3+\frac{11 x^4}{2}-\frac{8 x^5}{5}+\frac{x^6}{6}\\ \end{align*}

Mathematica [A]  time = 0.0010482, size = 34, normalized size = 1. \[ \frac{x^6}{6}-\frac{8 x^5}{5}+\frac{11 x^4}{2}-8 x^3+\frac{9 x^2}{2} \]

Antiderivative was successfully verified.

[In]

Integrate[x*(3 - 4*x + x^2)^2,x]

[Out]

(9*x^2)/2 - 8*x^3 + (11*x^4)/2 - (8*x^5)/5 + x^6/6

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 27, normalized size = 0.8 \begin{align*}{\frac{9\,{x}^{2}}{2}}-8\,{x}^{3}+{\frac{11\,{x}^{4}}{2}}-{\frac{8\,{x}^{5}}{5}}+{\frac{{x}^{6}}{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(x^2-4*x+3)^2,x)

[Out]

9/2*x^2-8*x^3+11/2*x^4-8/5*x^5+1/6*x^6

________________________________________________________________________________________

Maxima [A]  time = 1.0305, size = 35, normalized size = 1.03 \begin{align*} \frac{1}{6} \, x^{6} - \frac{8}{5} \, x^{5} + \frac{11}{2} \, x^{4} - 8 \, x^{3} + \frac{9}{2} \, x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(x^2-4*x+3)^2,x, algorithm="maxima")

[Out]

1/6*x^6 - 8/5*x^5 + 11/2*x^4 - 8*x^3 + 9/2*x^2

________________________________________________________________________________________

Fricas [A]  time = 1.60726, size = 65, normalized size = 1.91 \begin{align*} \frac{1}{6} x^{6} - \frac{8}{5} x^{5} + \frac{11}{2} x^{4} - 8 x^{3} + \frac{9}{2} x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(x^2-4*x+3)^2,x, algorithm="fricas")

[Out]

1/6*x^6 - 8/5*x^5 + 11/2*x^4 - 8*x^3 + 9/2*x^2

________________________________________________________________________________________

Sympy [A]  time = 0.059149, size = 29, normalized size = 0.85 \begin{align*} \frac{x^{6}}{6} - \frac{8 x^{5}}{5} + \frac{11 x^{4}}{2} - 8 x^{3} + \frac{9 x^{2}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(x**2-4*x+3)**2,x)

[Out]

x**6/6 - 8*x**5/5 + 11*x**4/2 - 8*x**3 + 9*x**2/2

________________________________________________________________________________________

Giac [A]  time = 1.10512, size = 35, normalized size = 1.03 \begin{align*} \frac{1}{6} \, x^{6} - \frac{8}{5} \, x^{5} + \frac{11}{2} \, x^{4} - 8 \, x^{3} + \frac{9}{2} \, x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(x^2-4*x+3)^2,x, algorithm="giac")

[Out]

1/6*x^6 - 8/5*x^5 + 11/2*x^4 - 8*x^3 + 9/2*x^2